package com.kudian.restful.vo.seller;

import java.util.Comparator;

/**
 * Created by apple on 16/7/16.
 */
public class ClientSellerComparator implements Comparator<ClientSellerItemVO> {
    /**
     * 如果o1小于o2,返回一个负数;如果o1大于o2，返回一个正数;如果他们相等，则返回0;
     */
    @Override
    public int compare(ClientSellerItemVO o1, ClientSellerItemVO o2) {

        if (o1.getDis() < o2.getDis()) {
            return -1;
        } else if (o1.getDis() > o2.getDis()) {
            return 1;
        }
        return 0;
    }
}
